package com.swk.service;

import java.sql.SQLException;

import com.swk.bean.Student;
import com.swk.dao.StudentDao;
import com.swk.exception.StudentNotExist;

/**
 * 
 * @author 慎伟康
 * 
 * @date 2017年9月19日 下午9:03:47
 * 
 * @Description TODO
 *		学生相关service
 */
public class StudentService {
	
	/**
	 * 获取学生信息
	 * @param studentId
	 * @return
	 * @throws SQLException
	 * @throws StudentNotExist
	 */
	public Student getStudentInfo(String studentId) throws SQLException, StudentNotExist{
		StudentDao sd = new StudentDao();
		Student s = null;
		s = sd.getStudentInfo(studentId);
		if(s == null){
			throw new StudentNotExist("该用户不存在！");
		}else{
			return s;
		}
	}
}
